<?php

namespace App\Http\Controllers\wechat\users;

use App\Http\Controllers\Controller;
use App\Service\product\ProductStatisticsService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use lxs\api\ApiResponse;

class StatisticsController extends Controller
{
    /**
     * 获取数据中心拉新数据
     */
    public function getDataCenterNewData(Request $request): JsonResponse
    {
        $uid = $request->uid;
        $is_show = $request->input('is_show');
        $page = $request->input('page');
        $pageSize = $request->input('page_size');

        $data = ProductStatisticsService::instance()->getProductStatisticsData($uid, $page, $pageSize, $is_show);

        return ApiResponse::success('获取数据中心拉新数据成功', [
            'lists' => $data['lists'],
            'page' => $data['page'],
            'page_size' => $data['page_size'],
            'total' => $data['total']
        ]);
    }


}
